home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / os2 / remin301.zip / PATCH301.ZIP / PATCH.01 < prev    next >
Text File  |  1992-12-28  |  70KB  |  2,203 lines

  1. Prereq: "03.00.00"
  2. *** ../p0/version.h    Mon Nov  9 14:12:11 1992
  3. --- ./version.h    Wed Dec 16 10:51:27 1992
  4. ***************
  5. *** 5,12 ****
  6.   /*  What version of remind do we have?                         */
  7.   /*                                                             */
  8.   /*  This file is part of REMIND.                               */
  9. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  10.   /*                                                             */
  11.   /***************************************************************/
  12.   
  13. ! #define VERSION "03.00.00"
  14. --- 5,12 ----
  15.   /*  What version of remind do we have?                         */
  16.   /*                                                             */
  17.   /*  This file is part of REMIND.                               */
  18. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  19.   /*                                                             */
  20.   /***************************************************************/
  21.   
  22. ! #define VERSION "03.00.01"
  23. *** ../p0/MANIFEST.DOS    Mon Nov  9 14:12:36 1992
  24. --- ./MANIFEST.DOS    Wed Dec 16 10:51:55 1992
  25. ***************
  26. *** 1,6 ****
  27. --- 1,7 ----
  28.   calendar.c
  29.   config.h
  30.   copyrigh
  31. + defs.rem
  32.   dorem.c
  33.   dosubst.c
  34.   err.h
  35. ***************
  36. *** 18,23 ****
  37. --- 19,25 ----
  38.   main.c
  39.   makefile
  40.   makefile.msc
  41. + makefile.os2
  42.   makefile.tc
  43.   manifest.dos
  44.   manifest.unx
  45. ***************
  46. *** 25,36 ****
  47. --- 27,43 ----
  48.   protos.h
  49.   queue.c
  50.   readme.dos
  51. + readme.os2
  52.   readme.uni
  53.   rem
  54.   rem.1
  55. + rem2ps.1
  56. + rem2ps.c
  57. + rem2ps.h
  58.   remind-a.csh
  59.   remind-a.sh
  60.   remind.1
  61. + remind.def
  62.   test-rem
  63.   test.cmp
  64.   test.rem
  65. *** ../p0/MANIFEST.UNX    Mon Nov  9 14:12:36 1992
  66. --- ./MANIFEST.UNX    Wed Dec 16 10:51:55 1992
  67. ***************
  68. *** 1,6 ****
  69.   calendar.c
  70.   config.h
  71. ! COPYRIGHT
  72.   dorem.c
  73.   dosubst.c
  74.   err.h
  75. --- 1,14 ----
  76. + COPYRIGHT
  77. + MANIFEST.DOS
  78. + MANIFEST.UNX
  79. + Makefile
  80. + README.DOS
  81. + README.OS2
  82. + README.UNIX
  83. + WHATSNEW.30
  84.   calendar.c
  85.   config.h
  86. ! defs.rem
  87.   dorem.c
  88.   dosubst.c
  89.   err.h
  90. ***************
  91. *** 16,36 ****
  92.   lnk.msc
  93.   lnk.tc
  94.   main.c
  95. - Makefile
  96.   makefile.msc
  97.   makefile.tc
  98. - MANIFEST.DOS
  99. - MANIFEST.UNX
  100.   omit.c
  101.   protos.h
  102.   queue.c
  103. - README.DOS
  104. - README.UNIX
  105.   rem
  106.   rem.1
  107.   remind-all.csh
  108.   remind-all.sh
  109.   remind.1
  110.   test-rem
  111.   test.cmp
  112.   test.rem
  113. --- 24,44 ----
  114.   lnk.msc
  115.   lnk.tc
  116.   main.c
  117.   makefile.msc
  118. + makefile.os2
  119.   makefile.tc
  120.   omit.c
  121.   protos.h
  122.   queue.c
  123.   rem
  124.   rem.1
  125. + rem2ps.1
  126. + rem2ps.c
  127. + rem2ps.h
  128.   remind-all.csh
  129.   remind-all.sh
  130.   remind.1
  131. + remind.def
  132.   test-rem
  133.   test.cmp
  134.   test.rem
  135. ***************
  136. *** 41,44 ****
  137.   utils.c
  138.   var.c
  139.   version.h
  140. - WHATSNEW.30
  141. --- 49,51 ----
  142. *** ../p0/Makefile    Mon Nov  9 14:12:26 1992
  143. --- ./Makefile    Wed Dec 16 10:54:10 1992
  144. ***************
  145. *** 7,13 ****
  146.   # Uncomment the next line if you are running on a SYSV system
  147.   # SYSV= -DSYSV
  148.   
  149. ! # Uncomment the next line if you are running on any type of UNIX system
  150.   UNIX= -DUNIX
  151.   
  152.   # Uncomment the next line if you want to use gcc instead of default compiler
  153. --- 7,13 ----
  154.   # Uncomment the next line if you are running on a SYSV system
  155.   # SYSV= -DSYSV
  156.   
  157. ! # Uncomment the next line if you are running under UNIX (including SYSV!)
  158.   UNIX= -DUNIX
  159.   
  160.   # Uncomment the next line if you want to use gcc instead of default compiler
  161. ***************
  162. *** 17,27 ****
  163.   CFLAGS= -O -ansi
  164.   CDEFS=
  165.   
  166.   #-----------------------------------------------------------------------------
  167.   # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  168.   # in config.h; then, you should be able to type 'make'.
  169.   #-----------------------------------------------------------------------------
  170. ! VERSION= 03.00.00
  171.   
  172.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
  173.   STDHDRS= config.h types.h protos.h globals.h err.h
  174. --- 17,51 ----
  175.   CFLAGS= -O -ansi
  176.   CDEFS=
  177.   
  178. + #### INSTALLATION LOCATIONS ####
  179. + # Note that I use 'cp' rather than 'install' for improved portability.
  180. + #
  181. + # BINDIR:  Where should the Remind executable be installed?
  182. + BINDIR= /usr/local/bin
  183. + # SCRIPTDIR:  Where should the kall and rem shell scripts be installed?
  184. + SCRIPTDIR= /usr/share/bin
  185. + # MANDIR:  Where should the man pages be installed?
  186. + MANDIR= /usr/local/man
  187. + # MANSECT:  Which man section should the man pages go into?
  188. + MANSECT= 1
  189. + # EXEMODE:  What file protection mode should be used for the executables?
  190. + EXEMODE= 755
  191. + # MANMODE:  What file protection mode should be used for the man pages?
  192. + MANMODE= 644
  193. + # OWNER:  What owner and group to use for executables, scripts and man pages?
  194. + OWNER=bin.bin
  195.   #-----------------------------------------------------------------------------
  196.   # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  197.   # in config.h; then, you should be able to type 'make'.
  198.   #-----------------------------------------------------------------------------
  199. ! VERSION= 03.00.01
  200.   
  201.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
  202.   STDHDRS= config.h types.h protos.h globals.h err.h
  203. ***************
  204. *** 30,48 ****
  205.   
  206.   MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
  207.   remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
  208. ! makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1
  209.   
  210.   OBJS= $(SRCS:.c=.o)
  211.   
  212. ! remind: $(OBJS)
  213. !     $(CC) -o remind $(OBJS)
  214.   
  215.   .c.o:
  216.       $(CC) $(UNIX) $(SYSV) -c -o $*.o $(CFLAGS) $(CDEFS) $*.c
  217.   
  218.   clean:
  219.       rm -f *.o *~
  220.   
  221.   calendar.o: calendar.c $(STDHDRS) expr.h
  222.   dorem.o: dorem.c $(STDHDRS) expr.h
  223.   dosubst.o: dosubst.c $(STDHDRS)
  224. --- 54,79 ----
  225.   
  226.   MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
  227.   remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
  228. ! makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
  229. ! defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1
  230.   
  231.   OBJS= $(SRCS:.c=.o)
  232.   
  233. ! all: remind rem2ps
  234.   
  235.   .c.o:
  236.       $(CC) $(UNIX) $(SYSV) -c -o $*.o $(CFLAGS) $(CDEFS) $*.c
  237.   
  238. + rem2ps: rem2ps.o
  239. +     $(CC) -o rem2ps rem2ps.o
  240. + remind: $(OBJS)
  241. +     $(CC) -o remind $(OBJS)
  242.   clean:
  243.       rm -f *.o *~
  244.   
  245. + rem2ps.o: rem2ps.c
  246.   calendar.o: calendar.c $(STDHDRS) expr.h
  247.   dorem.o: dorem.c $(STDHDRS) expr.h
  248.   dosubst.o: dosubst.c $(STDHDRS)
  249. ***************
  250. *** 61,75 ****
  251.   var.o: var.c $(STDHDRS) expr.h
  252.   
  253.   tarZ:
  254. !     tar cvf remind-3.0.0.tar $(MANIFEST)
  255. !     compress -v remind-3.0.0.tar
  256.   
  257.   shar:
  258.       shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  259.   
  260.   todos:
  261. -     mdel 'a:*.*'
  262. -     mdel 'a:*'
  263.       mcopy -tn $(MANIFEST) a:
  264.   
  265.   fromdos:
  266. --- 92,104 ----
  267.   var.o: var.c $(STDHDRS) expr.h
  268.   
  269.   tarZ:
  270. !     tar cvf remind-3.0.1.tar $(MANIFEST)
  271. !     compress -v remind-3.0.1.tar
  272.   
  273.   shar:
  274.       shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  275.   
  276.   todos:
  277.       mcopy -tn $(MANIFEST) a:
  278.   
  279.   fromdos:
  280. ***************
  281. *** 76,81 ****
  282. --- 105,111 ----
  283.       mcopy -tn 'a:*' .
  284.       -mv -f copyrigh COPYRIGHT
  285.       -mv -f makefile Makefile
  286. +     -mv -f readme.os2 README.OS2
  287.       -mv -f readme.dos README.DOS
  288.       -mv -f readme.uni README.UNIX
  289.       -mv -f remind-a.csh remind-all.csh
  290. ***************
  291. *** 89,92 ****
  292.       cp $(MANIFEST) ../backup
  293.   
  294.   transmit:
  295. !     sz -a -Z -e $(MANIFEST)
  296. --- 119,154 ----
  297.       cp $(MANIFEST) ../backup
  298.   
  299.   transmit:
  300. !     sz -a -e $(MANIFEST)
  301. ! install:  install-bin install-scripts install-man
  302. ! install-bin: remind rem2ps
  303. !     cp remind $(BINDIR)/remind
  304. !     -chmod $(EXEMODE) $(BINDIR)/remind
  305. !     -chown $(OWNER) $(BINDIR)/remind
  306. !     cp rem2ps $(BINDIR)/rem2ps
  307. !     -chmod $(EXEMODE) $(BINDIR)/rem2ps
  308. !     -chown $(OWNER) $(BINDIR)/rem2ps
  309. ! install-scripts:
  310. !     cp kall $(SCRIPTDIR)/kall
  311. !     -chmod $(EXEMODE) $(SCRIPTDIR)/kall
  312. !     -chown $(OWNER) $(SCRIPTDIR)/kall
  313. !     cp rem $(SCRIPTDIR)/rem
  314. !     -chmod $(EXEMODE) $(SCRIPTDIR)/rem
  315. !     -chown $(OWNER) $(SCRIPTDIR)/rem
  316. ! install-man:
  317. !     cp remind.1 $(MANDIR)/man$(MANSECT)/remind.$(MANSECT)
  318. !     -chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/remind.$(MANSECT)
  319. !     -chown $(OWNER) $(MANDIR)/man$(MANSECT)/remind.$(MANSECT)
  320. !     cp rem.1 $(MANDIR)/man$(MANSECT)/rem.$(MANSECT)
  321. !     -chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/rem.$(MANSECT)
  322. !     -chown $(OWNER) $(MANDIR)/man$(MANSECT)/rem.$(MANSECT)
  323. !     cp kall.1 $(MANDIR)/man$(MANSECT)/kall.$(MANSECT)
  324. !     -chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/kall.$(MANSECT)
  325. !     -chown $(OWNER) $(MANDIR)/man$(MANSECT)/kall.$(MANSECT)
  326. !     cp rem2ps.1 $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
  327. !     -chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
  328. !     -chown $(OWNER) $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
  329. *** ../p0/README.DOS    Mon Nov  9 14:12:05 1992
  330. --- ./README.DOS    Wed Dec 16 10:51:22 1992
  331. ***************
  332. *** 15,19 ****
  333. --- 15,27 ----
  334.   
  335.   This will create REMIND.EXE, which is ready to be executed.
  336.   
  337. + The file "defs.rem" has some sample Remind definitions and commands.
  338.   --
  339.   David F. Skoll <dfs@doe.carleton.ca>
  340. + 4-317 LeBreton Street South
  341. + Ottawa, Ontario K1S 4L4
  342. + CANADA
  343. + Tel. (613) 567-3662
  344. *** ../p0/README.UNIX    Mon Nov  9 14:12:05 1992
  345. --- ./README.UNIX    Wed Dec 16 10:51:21 1992
  346. ***************
  347. *** 16,25 ****
  348.   
  349.   5 - Type 'make'
  350.   
  351. ! 6 - Type 'test-rem' to run the acceptance test
  352.   
  353. ! 7 - Copy the remind executable to the appropriate directory, and copy
  354. !     the man page to the man directory.
  355.   
  356.   Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
  357.   These allow automatic mailing of reminders to all users who create a
  358. --- 16,25 ----
  359.   
  360.   5 - Type 'make'
  361.   
  362. ! 6 - Type 'sh test-rem' to run the acceptance test
  363.   
  364. ! 7 - Type 'make install' to install Remind, kall, rem and the man
  365. !     pages.
  366.   
  367.   Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
  368.   These allow automatic mailing of reminders to all users who create a
  369. ***************
  370. *** 38,46 ****
  371. --- 38,61 ----
  372.   is provided.  You should examine the script to ensure that the defaults
  373.   are correct.
  374.   
  375. + Many people have asked me why I supply the "rem" script instead of
  376. + having Remind assume a default file.  The answer is: That's how I like
  377. + it!  My personal preference is for a program which normally takes
  378. + parameters to display usage information when invoked with no
  379. + parameters.  I like that behaviour so I can quickly get an idea of
  380. + what a program does without poring through the man page.  And I think
  381. + I'll keep Remind that way.  Sorry to all who dislike it. :-)
  382.   A shell script called "kall" is provided so you can kill your background
  383.   remind processes when you log out.  See the man page.  Note that kall
  384.   depends on the output of "ps", and may not be portable.
  385.   
  386. + The file "defs.rem" has some sample Remind definitions and commands.
  387.   --
  388.   David F. Skoll <dfs@doe.carleton.ca>
  389. + 4-317 LeBreton Street South
  390. + Ottawa, Ontario K1S 4L4
  391. + CANADA
  392. + Tel. (613) 567-3662
  393. *** ../p0/WHATSNEW.30    Mon Nov  9 14:12:37 1992
  394. --- ./WHATSNEW.30    Wed Dec 16 10:51:56 1992
  395. ***************
  396. *** 1,5 ****
  397. --- 1,50 ----
  398.   CHANGES TO REMIND
  399.   
  400. + *** PLEASE NOTE:  AFTER 24 FEBRUARY, 1993, MY NEW ADDRESS WILL BE:
  401. + 986 Eiffel Avenue,
  402. + Ottawa, Ontario
  403. + Canada
  404. + * Version 3.0 Patch 1
  405. + - Wrote the Rem2ps program to produce PostScript calendars
  406. + - Added an 'install' target to the Makefile
  407. + - Fixed a bug which allowed the shell() function to execute in timed
  408. +   reminders which were queued with RUN disabled.
  409. + - Added support for OS/2, courtesy of DARREL HANKERSON
  410. +   <HANK@DUCVAX.AUBURN.EDU>
  411. + - In expressions, can now specify literal dates as 'yyyy/mm/dd' rather than
  412. +   using the date() function.
  413. + - Fixed all the source files to include "config.h" first.
  414. + - Changed the way triggers are calculated so that trigger dates are 
  415. +   always valid if year, month and day are specified, and there is no
  416. +   UNTIL clause.  See MAN page section "DETAILS ABOUT TRIGVALID()."
  417. + - Defined _POSIX_SOURCE so Remind will compile on SGI workstations (and
  418. +   be more portable... I hope.)
  419. + - Fixed some rather brain-dead definitions of UPPER and LOWER, as pointed
  420. +   out by <rsalz@osf.org>
  421. + - Added more details to the Man page concerning how triggers are computed,
  422. +   and added warnings about computing OMIT dates.
  423. + - Added the file defs.rem which contains examples of useful definitions and
  424. +   triggers.
  425. + - Changed the script test-rem to be a sh script instead of csh for improved
  426. +   portability.
  427. + - Fixed up the README.* files to reflect the changes.
  428. + - Re-formatted the WHATSNEW.30 file.
  429.   * Version 3.0
  430.   
  431.   - Total rewrite from previous versions
  432. ***************
  433. *** 21,100 ****
  434.   - Fixed a lurking bug in trigger date calculation which, amazingly, had not
  435.     been caught in the couple of years that Remind has been out!
  436.   
  437. ! * Version 2.4 Patch 5 - Added the "c+n" option for printing a calendar by
  438. ! weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
  439.   
  440. ! * Version 2.3 Patch 4 - Made the init.c file nicer.  Made the Makefile
  441. ! prettier.  Added "make test", "make tar" and "make shar" Makefile targets.
  442.   
  443. ! * Version 2.3 Patch 3 - Added a command-line option for Remind to process
  444. ! queued reminders in the foreground.  This makes automatic termination
  445. ! of Remind processes from within X-Windows and Sunview easier.
  446.   
  447. ! * Version 2.3 Patch 2 - Fixed up a problem with timed reminders which resulted
  448. ! in cursor not starting from left side of screen on some systems.
  449.   
  450. ! Fixed the SIGINT handler for SYSV systems - this was interrupting the
  451. ! sleep(2) system call.
  452.   
  453. ! Closed stdin and stdout if remind was part of a pipe - this prevents other
  454. ! sections of the pipe from hanging as remind puts itself in the background.
  455.   
  456. ! Added the "-h" (Hush mode) option
  457.   
  458. ! Added the "%#" and "%@" modifiers for the current time.
  459.   
  460. ! Made the Makefile more portable
  461.   
  462. ! * Version 2.3 Patch 1 - Added the "-t" command-line option to get Remind
  463. ! to trigger all non-expired reminders.
  464.   
  465. ! Added Turbo C support courtesy of Rhys Weatherly
  466.   
  467. ! Added the "RUN ON" and "RUN OFF" commands for a secure interface with
  468. ! the Elm mail system.
  469.   
  470. ! Added the "rem" shell script for running Remind with a default script.
  471.   
  472. ! Added manual pages for "kall" and "rem".
  473.   
  474. ! * Version 2.3 - Added the UNTIL keyword for forcing reminders to expire.
  475.   
  476. ! Added the "++" form of 'back' and the "--" form of 'delta' for
  477. ! ignoring OMIT information.
  478.   
  479. ! Added the CLEAR-OMIT-CONTEXT, PUSH-OMIT-CONTEXT and POP-OMIT-CONTEXT
  480. ! keywords for isolating personal or peculiar reminders from the global
  481. ! OMIT context.
  482.   
  483. ! Speeded up the parsing of tokens.
  484.   
  485. ! Changed the source to recognize and exploit ANSI-C compilers which
  486. ! accept function prototypes.
  487.   
  488. ! Added the "-n" option to output the next occurrence of each reminder
  489. ! in SimpleCalendar format
  490.   
  491. ! Modified the calendar and SimpleCalendar formats so that the % escape
  492. ! substitutions ARE performed.
  493.   
  494. ! * Version 2.2 - Patch 5 - Added the BEFORE, AFTER and SKIP tokens to make the
  495. ! handling of holidays more sensible.  Also corrected a few more bugs.
  496.   
  497. ! * Version 2.2 - Patch 3  - Added the MSG or RUN tokens in an OMIT command; also
  498. ! allowed RUN-type reminders to be explicitly included in the calendar by
  499. ! using the %" escape sequence.
  500.   
  501. ! * Version 2.2 - Added the AT keyword, the timed reminders daemon, and the
  502. ! calendar facility.
  503.   
  504. ! * Version 2.1 - Added the "repeat" token for repeating reminders with a period
  505. ! other than 7 days.  Also fixed some bugs from version 2.0
  506.   
  507. ! * Version 2.0 - first public release.  Included advanced date specifications,
  508. ! character substitution, and the RUN keyword.
  509.   
  510. ! * Version 1.0 - never publicly released.
  511.   
  512.   
  513.   
  514. --- 66,169 ----
  515.   - Fixed a lurking bug in trigger date calculation which, amazingly, had not
  516.     been caught in the couple of years that Remind has been out!
  517.   
  518. ! * Version 2.4 Patch 5 
  519.   
  520. ! - Added the "c+n" option for printing a calendar by
  521. !   weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
  522.   
  523. ! * Version 2.3 Patch 4
  524.   
  525. ! - Made the init.c file nicer.  Made the Makefile
  526. !   prettier.  Added "make test", "make tar" and "make shar" Makefile targets.
  527.   
  528. ! * Version 2.3 Patch 3
  529.   
  530. ! - Added a command-line option for Remind to process
  531. !   queued reminders in the foreground.  This makes automatic termination
  532. !   of Remind processes from within X-Windows and Sunview easier.
  533.   
  534. ! * Version 2.3 Patch 2
  535.   
  536. ! - Fixed up a problem with timed reminders which resulted
  537. !   in cursor not starting from left side of screen on some systems.
  538.   
  539. ! - Fixed the SIGINT handler for SYSV systems - this was interrupting the
  540. !   sleep(2) system call.
  541.   
  542. ! - Closed stdin and stdout if remind was part of a pipe - this prevents other
  543. !   sections of the pipe from hanging as remind puts itself in the background.
  544.   
  545. ! - Added the "-h" (Hush mode) option
  546.   
  547. ! - Added the "%#" and "%@" modifiers for the current time.
  548.   
  549. ! - Made the Makefile more portable
  550.   
  551. ! * Version 2.3 Patch 1
  552.   
  553. ! - Added the "-t" command-line option to get Remind
  554. !   to trigger all non-expired reminders.
  555.   
  556. ! - Added Turbo C support courtesy of Rhys Weatherly
  557.   
  558. ! - Added the "RUN ON" and "RUN OFF" commands for a secure interface with
  559. !   the Elm mail system.
  560.   
  561. ! - Added the "rem" shell script for running Remind with a default script.
  562.   
  563. ! - Added manual pages for "kall" and "rem".
  564.   
  565. ! * Version 2.3
  566.   
  567. ! - Added the UNTIL keyword for forcing reminders to expire.
  568.   
  569. ! - Added the "++" form of 'back' and the "--" form of 'delta' for
  570. !   ignoring OMIT information.
  571.   
  572. ! - Added the CLEAR-OMIT-CONTEXT, PUSH-OMIT-CONTEXT and POP-OMIT-CONTEXT
  573. !   keywords for isolating personal or peculiar reminders from the global
  574. !   OMIT context.
  575.   
  576. ! - Speeded up the parsing of tokens.
  577.   
  578. ! - Changed the source to recognize and exploit ANSI-C compilers which
  579. !   accept function prototypes.
  580.   
  581. ! - Added the "-n" option to output the next occurrence of each reminder
  582. !   in SimpleCalendar format
  583.   
  584. ! - Modified the calendar and SimpleCalendar formats so that the % escape
  585. !   substitutions ARE performed.
  586. ! * Version 2.2 - Patch 5
  587. ! - Added the BEFORE, AFTER and SKIP tokens to make the
  588. !   handling of holidays more sensible.  Also corrected a few more bugs.
  589. ! * Version 2.2 - Patch 3
  590. ! - Added the MSG or RUN tokens in an OMIT command; also
  591. !   allowed RUN-type reminders to be explicitly included in the calendar by
  592. !   using the %" escape sequence.
  593. ! * Version 2.2
  594. ! - Added the AT keyword, the timed reminders daemon, and the
  595. !   calendar facility.
  596. ! * Version 2.1
  597. ! - Added the "repeat" token for repeating reminders with a period
  598. !   other than 7 days.  Also fixed some bugs from version 2.0
  599. ! * Version 2.0
  600. ! - first public release.  Included advanced date specifications,
  601. !   character substitution, and the RUN keyword.
  602. ! * Version 1.0
  603. ! - never publicly released.
  604.   
  605.   
  606.   
  607. *** ../p0/calendar.c    Mon Nov  9 14:12:13 1992
  608. --- ./calendar.c    Wed Dec 16 10:51:29 1992
  609. ***************
  610. *** 173,182 ****
  611. --- 173,202 ----
  612.   static void DoCalendarOneMonth()
  613.   #endif
  614.   {
  615. +    int y, m, d, mm, yy;
  616.      if (!DoSimpleCalendar) WriteCalHeader();
  617.   
  618. +    if (PsCal) {
  619. +       FromJulian(JulianToday, &y, &m, &d);
  620. +       printf("%s\n", PSBEGIN);
  621. +       printf("%s %d %d %d\n",
  622. +               MonthName[m], y, DaysInMonth(m, y), (JulianToday+1) % 7);
  623. +       mm = m-1;
  624. +       if (mm<0) {
  625. +          mm = 11; yy = y-1;
  626. +       } else yy=y;
  627. +       printf("%s %d\n", MonthName[mm], DaysInMonth(mm,yy));
  628. +       mm = m+1;
  629. +       if (mm>11) {
  630. +          mm = 0; yy = y+1;
  631. +       } else yy=y;
  632. +       printf("%s %d\n", MonthName[mm], DaysInMonth(mm,yy));
  633. +    }
  634.      while (WriteCalendarRow()) continue;
  635.   
  636. +    if (PsCal) printf("%s\n", PSEND);
  637.      if (!DoSimpleCalendar) WriteCalTrailer();
  638.   }   
  639.   
  640. *** ../p0/config.h    Mon Nov  9 14:12:07 1992
  641. --- ./config.h    Wed Dec 16 10:51:23 1992
  642. ***************
  643. *** 7,13 ****
  644.   /*  care of certain system dependencies.                       */
  645.   /*                                                             */
  646.   /*  This file is part of REMIND.                               */
  647. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  648.   /*                                                             */
  649.   /***************************************************************/
  650.   
  651. --- 7,13 ----
  652.   /*  care of certain system dependencies.                       */
  653.   /*                                                             */
  654.   /*  This file is part of REMIND.                               */
  655. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  656.   /*                                                             */
  657.   /***************************************************************/
  658.   
  659. ***************
  660. *** 109,115 ****
  661. --- 109,117 ----
  662.   /*---------------------------------------------------------------------*/
  663.   /* Do we have the <unistd.h> header?  If not, use sys/files.h          */
  664.   /*---------------------------------------------------------------------*/
  665. + #ifdef UNIX
  666.   #define HAVE_UNISTD 1
  667. + #endif
  668.   
  669.   /*---------------------------------------------------------------------*/
  670.   /* How many attempts to resolve a weird date spec?                     */
  671. ***************
  672. *** 151,153 ****
  673. --- 153,162 ----
  674.   /*---------------------------------------------------------------------*/
  675.   #define PUBLIC
  676.   #define PRIVATE static
  677. + #ifdef UNIX
  678. + #define _POSIX_SOURCE
  679. + #endif
  680. + #define PSBEGIN "# rem2ps begin"
  681. + #define PSEND   "# rem2ps end"
  682. *** ../p0/dorem.c    Mon Nov  9 14:12:13 1992
  683. --- ./dorem.c    Wed Dec 16 10:51:30 1992
  684. ***************
  685. *** 10,17 ****
  686.   /*  Copyright (C) 1992 by David F. Skoll.                      */
  687.   /*                                                             */
  688.   /***************************************************************/
  689. - #include <stdio.h>
  690.   #include "config.h"
  691.   #ifdef HAVE_STDLIB_H
  692.   #include <stdlib.h>
  693.   #endif
  694. --- 10,17 ----
  695.   /*  Copyright (C) 1992 by David F. Skoll.                      */
  696.   /*                                                             */
  697.   /***************************************************************/
  698.   #include "config.h"
  699. + #include <stdio.h>
  700.   #ifdef HAVE_STDLIB_H
  701.   #include <stdlib.h>
  702.   #endif
  703. *** ../p0/dosubst.c    Mon Nov  9 14:12:14 1992
  704. --- ./dosubst.c    Wed Dec 16 10:51:30 1992
  705. ***************
  706. *** 9,17 ****
  707.   /*  Copyright (C) 1992 by David F. Skoll.                      */
  708.   /*                                                             */
  709.   /***************************************************************/
  710.   #include <stdio.h>
  711.   #include <ctype.h>
  712. - #include "config.h"
  713.   #ifdef HAVE_STDLIB_H
  714.   #include <stdlib.h>
  715.   #endif
  716. --- 9,17 ----
  717.   /*  Copyright (C) 1992 by David F. Skoll.                      */
  718.   /*                                                             */
  719.   /***************************************************************/
  720. + #include "config.h"
  721.   #include <stdio.h>
  722.   #include <ctype.h>
  723.   #ifdef HAVE_STDLIB_H
  724.   #include <stdlib.h>
  725.   #endif
  726. ***************
  727. *** 110,116 ****
  728.         if (err) return err;
  729.         if (c == '\n') continue;
  730.         if (!c) {
  731. !          if (mode != CAL_MODE) *s++ = '\n';
  732.        *s++ = 0;
  733.        break;
  734.         }
  735. --- 110,116 ----
  736.         if (err) return err;
  737.         if (c == '\n') continue;
  738.         if (!c) {
  739. !          if (mode != CAL_MODE && t->typ != RUN_TYPE) *s++ = '\n';
  740.        *s++ = 0;
  741.        break;
  742.         }
  743. ***************
  744. *** 346,352 ****
  745.           s += strlen(s);
  746.           break;
  747.   
  748. !          case '_': sprintf(s, "%s", NL);
  749.           s += strlen(s);
  750.           break;
  751.   
  752. --- 346,356 ----
  753.           s += strlen(s);
  754.           break;
  755.   
  756. !          case '_': 
  757. !             if (mode != CAL_MODE)
  758. !                sprintf(s, "%s", NL);
  759. !             else
  760. !                sprintf(s, " ");
  761.           s += strlen(s);
  762.           break;
  763.   
  764. *** ../p0/err.h    Mon Nov  9 14:12:07 1992
  765. --- ./err.h    Wed Dec 16 10:51:24 1992
  766. ***************
  767. *** 5,11 ****
  768.   /*  Error definitions.                                         */
  769.   /*                                                             */
  770.   /*  This file is part of REMIND.                               */
  771. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  772.   /*                                                             */
  773.   /***************************************************************/
  774.   
  775. --- 5,11 ----
  776.   /*  Error definitions.                                         */
  777.   /*                                                             */
  778.   /*  This file is part of REMIND.                               */
  779. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  780.   /*                                                             */
  781.   /***************************************************************/
  782.   
  783. *** ../p0/expr.c    Mon Nov  9 14:12:16 1992
  784. --- ./expr.c    Wed Dec 16 10:51:32 1992
  785. ***************
  786. *** 5,23 ****
  787.   /*  This file contains routines to parse and evaluate          */
  788.   /*  expressions.                                               */
  789.   /*                                                             */
  790. ! /*  Copyright 1991 by David F. Skoll.                          */
  791.   /*                                                             */
  792.   /***************************************************************/
  793.   
  794. ! /* If we're using Turbo C, turn off annoying warning messages! */
  795. ! #ifdef __TURBOC__
  796. ! #pragma warn -pia
  797. ! #endif
  798.   #include <stdio.h>
  799.   #include <ctype.h>
  800.   #include <string.h>
  801. - #include "config.h"
  802.   #ifdef HAVE_STDLIB_H
  803.   #include <stdlib.h>
  804.   #endif
  805. --- 5,18 ----
  806.   /*  This file contains routines to parse and evaluate          */
  807.   /*  expressions.                                               */
  808.   /*                                                             */
  809. ! /*  Copyright 1992 by David F. Skoll.                          */
  810.   /*                                                             */
  811.   /***************************************************************/
  812.   
  813. ! #include "config.h"
  814.   #include <stdio.h>
  815.   #include <ctype.h>
  816.   #include <string.h>
  817.   #ifdef HAVE_STDLIB_H
  818.   #include <stdlib.h>
  819.   #endif
  820. ***************
  821. *** 62,67 ****
  822. --- 57,63 ----
  823.   PRIVATE int MakeValue ARGS ((char *s, Value *v, Var *locals));
  824.   PRIVATE int PushOpStack ARGS ((Operator *op));
  825.   PRIVATE int PopOpStack ARGS ((Operator *op));
  826. + PRIVATE int ParseLiteralDate ARGS ((char **s, int *jul));
  827.   
  828.   /* Binary operators - all left-associative */
  829.   
  830. ***************
  831. *** 236,243 ****
  832.         if (c == '\"') return OK ; else return E_MISS_QUOTE;
  833.      }
  834.   
  835. !    if (!ISID(c)) return E_ILLEGAL_CHAR;
  836.   
  837.      /* Parse a constant, variable name or function */
  838.      while (ISID(**in) || **in == ':') *out++ = *(*in)++;
  839.   
  840. --- 232,249 ----
  841.         if (c == '\"') return OK ; else return E_MISS_QUOTE;
  842.      }
  843.   
  844. !    /* Dates can be specified with single-quotes */
  845. !    if (c == '\'') {
  846. !       while (**in) if ((c = *out++ = *(*in)++) == '\'') break;
  847. !       *out = 0;
  848. !       if (c == '\'') return OK ; else return E_MISS_QUOTE;
  849. !    }
  850.   
  851. +    if (!ISID(c)) {
  852. +       Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], c);
  853. +       return E_ILLEGAL_CHAR;
  854. +    }
  855.      /* Parse a constant, variable name or function */
  856.      while (ISID(**in) || **in == ':') *out++ = *(*in)++;
  857.   
  858. ***************
  859. *** 337,343 ****
  860.              r = Evaluate(s, locals);
  861.              if (r) return r;
  862.              if (*ExprBuf == ')') break;
  863. !            else if (*ExprBuf != ',') return E_ILLEGAL_CHAR;
  864.               }
  865.           if (f) r = CallFunc(f, args);
  866.           else {
  867. --- 343,352 ----
  868.              r = Evaluate(s, locals);
  869.              if (r) return r;
  870.              if (*ExprBuf == ')') break;
  871. !            else if (*ExprBuf != ',') {
  872. !            Eprint("Expecting comma, found '%c'", *ExprBuf);
  873. !               return E_ILLEGAL_CHAR;
  874. !                }
  875.               }
  876.           if (f) r = CallFunc(f, args);
  877.           else {
  878. ***************
  879. *** 352,358 ****
  880.               r = PushOpStack(f);
  881.               if (r) return r;
  882.           continue;  /* Still looking for an atomic vlue */
  883. !      } else if (!ISID(*ExprBuf) && *ExprBuf != '"') {
  884.           return E_ILLEGAL_CHAR;
  885.        } else { /* Must be a literal value */
  886.           r = MakeValue(ExprBuf, &va, locals);
  887. --- 361,368 ----
  888.               r = PushOpStack(f);
  889.               if (r) return r;
  890.           continue;  /* Still looking for an atomic vlue */
  891. !      } else if (!ISID(*ExprBuf) && *ExprBuf != '"' && *ExprBuf != '\'') {
  892. !             Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], *ExprBuf);
  893.           return E_ILLEGAL_CHAR;
  894.        } else { /* Must be a literal value */
  895.           r = MakeValue(ExprBuf, &va, locals);
  896. ***************
  897. *** 408,415 ****
  898.   /***************************************************************/
  899.   /*                                                             */
  900.   /*  MakeValue                                                  */
  901. ! /*  Generate a literal value.  It's either a string, a number  */
  902. ! /*  or the value of a symbol.                                  */
  903.   /*                                                             */
  904.   /***************************************************************/
  905.   #ifdef HAVE_PROTOS
  906. --- 418,425 ----
  907.   /***************************************************************/
  908.   /*                                                             */
  909.   /*  MakeValue                                                  */
  910. ! /*  Generate a literal value.  It's either a string, a number, */
  911. ! /*  a date or the value of a symbol.                           */
  912.   /*                                                             */
  913.   /***************************************************************/
  914.   #ifdef HAVE_PROTOS
  915. ***************
  916. *** 435,440 ****
  917. --- 445,457 ----
  918.         strncpy(v->v.str, s+1, len-1);
  919.         *(v->v.str+len-1) = 0;
  920.         return OK;
  921. +    } else if (*s == '\'') { /* It's a literal date */
  922. +       s++;
  923. +       if ((r=ParseLiteralDate(&s, &h))) return r;
  924. +       if (*s != '\'') return E_BAD_DATE;
  925. +       v->type = DATE_TYPE;
  926. +       v->v.val = h;
  927. +       return OK;
  928.      } else if (isdigit(*s)) { /* It's a number - use len to hold it.*/
  929.         len = 0;
  930.         while (*s && isdigit(*s)) {
  931. ***************
  932. *** 640,670 ****
  933.              } else return E_2LOW;
  934.   
  935.           case STR_TYPE:
  936. -            y=0; m=0; d=0;
  937.              s = v->v.str;
  938. !            if (!isdigit(*s)) return E_CANT_COERCE;
  939. !            while (isdigit(*s)) {
  940. !           y *= 10;
  941. !           y += *s++ - '0';
  942. !            }
  943. !            if (*s++ != '/') return E_CANT_COERCE;
  944. !            if (!isdigit(*s)) return E_CANT_COERCE;
  945. !            while (isdigit(*s)) {
  946. !           m *= 10;
  947. !           m += *s++ - '0';
  948. !            }
  949. !            m--;
  950. !            if (*s++ != '/') return E_CANT_COERCE;
  951. !            if (!isdigit(*s)) return E_CANT_COERCE;
  952. !            while (isdigit(*s)) {
  953. !           d *= 10;
  954. !           d += *s++ - '0';
  955. !            }
  956. !            if (*s || y < BASE || y > BASE+YR_RANGE ||
  957. !             m>11 || d<1 || d>DaysInMonth(m, y)) return E_CANT_COERCE;
  958.              v->type = DATE_TYPE;
  959.              free(v->v.str);
  960. !            v->v.val = Julian(y, m, d);
  961.              return OK;
  962.   
  963.           default: return E_CANT_COERCE;
  964. --- 657,668 ----
  965.              } else return E_2LOW;
  966.   
  967.           case STR_TYPE:
  968.              s = v->v.str;
  969. !            if (ParseLiteralDate(&s, &i)) return E_CANT_COERCE;
  970. !            if (*s) return E_CANT_COERCE;
  971.              v->type = DATE_TYPE;
  972.              free(v->v.str);
  973. !            v->v.val = i;
  974.              return OK;
  975.   
  976.           default: return E_CANT_COERCE;
  977. ***************
  978. *** 1209,1212 ****
  979. --- 1207,1255 ----
  980.         dest->v.val = src->v.val;
  981.         return OK;
  982.      }
  983. + }
  984. + /***************************************************************/
  985. + /*                                                             */
  986. + /*  ParseLiteralDate                                           */
  987. + /*                                                             */
  988. + /*  Parse a literal date.  Return result in jul, update s.     */
  989. + /*                                                             */
  990. + /***************************************************************/
  991. + #ifdef HAVE_PROTOS
  992. + PRIVATE int ParseLiteralDate(char **s, int *jul)
  993. + #else
  994. + static int ParseLiteralDate(s, jul)
  995. + char **s;
  996. + int *jul;
  997. + #endif
  998. + {
  999. +    int y, m, d;
  1000. +    y=0; m=0; d=0;
  1001. +    if (!isdigit(**s)) return E_BAD_DATE;
  1002. +    while (isdigit(**s)) {
  1003. +       y *= 10;
  1004. +       y += *(*s)++ - '0';
  1005. +    }
  1006. +    if (*(*s)++ != '/') return E_BAD_DATE;
  1007. +    if (!isdigit(**s)) return E_BAD_DATE;
  1008. +    while (isdigit(**s)) {
  1009. +       m *= 10;
  1010. +       m += *(*s)++ - '0';
  1011. +    }
  1012. +    m--;
  1013. +    if (*(*s)++ != '/') return E_BAD_DATE;
  1014. +    if (!isdigit(**s)) return E_BAD_DATE;
  1015. +    while (isdigit(**s)) {
  1016. +       d *= 10;
  1017. +       d += *(*s)++ - '0';
  1018. +    }
  1019. +    if (y < BASE || y > BASE+YR_RANGE || m<0 ||
  1020. +         m>11 || d<1 || d>DaysInMonth(m, y)) return E_BAD_DATE;
  1021. +    *jul = Julian(y, m, d);
  1022. +    return OK;
  1023.   }
  1024. *** ../p0/expr.h    Mon Nov  9 14:12:08 1992
  1025. --- ./expr.h    Wed Dec 16 10:51:24 1992
  1026. ***************
  1027. *** 5,11 ****
  1028.   /*  Contains a few definitions used by expression evaluator.   */
  1029.   /*                                                             */
  1030.   /*  This file is part of REMIND.                               */
  1031. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  1032.   /*                                                             */
  1033.   /***************************************************************/
  1034.   
  1035. --- 5,11 ----
  1036.   /*  Contains a few definitions used by expression evaluator.   */
  1037.   /*                                                             */
  1038.   /*  This file is part of REMIND.                               */
  1039. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1040.   /*                                                             */
  1041.   /***************************************************************/
  1042.   
  1043. *** ../p0/files.c    Mon Nov  9 14:12:17 1992
  1044. --- ./files.c    Wed Dec 16 10:51:33 1992
  1045. ***************
  1046. *** 33,39 ****
  1047.   #include <dos.h>
  1048.   #endif
  1049.   
  1050. - #include "config.h"
  1051.   #include "types.h"
  1052.   #include "protos.h"
  1053.   #include "globals.h"
  1054. --- 33,38 ----
  1055. ***************
  1056. *** 428,434 ****
  1057.   /*  file.  Not needed for UNIX.                                */
  1058.   /*                                                             */
  1059.   /***************************************************************/
  1060. ! #ifdef __MSDOS__
  1061.   /*
  1062.    * WARNING WARNING WARNING WARNING
  1063.    * In the version of Turbo C which I have, there is a bug in the
  1064. --- 427,433 ----
  1065.   /*  file.  Not needed for UNIX.                                */
  1066.   /*                                                             */
  1067.   /***************************************************************/
  1068. ! #if defined(__MSDOS__) || defined(OS2)
  1069.   /*
  1070.    * WARNING WARNING WARNING WARNING
  1071.    * In the version of Turbo C which I have, there is a bug in the
  1072. ***************
  1073. *** 449,463 ****
  1074.   int jul;
  1075.   #endif
  1076.   {
  1077. !    int y, m, d;
  1078.   #ifdef __TURBOC__   
  1079.      struct ftime ft;
  1080. - #endif   
  1081.      FILE *f;
  1082.   
  1083.      FromJulian(jul, &y, &m, &d);
  1084. -    
  1085. - #ifdef __TURBOC__   
  1086.      ft.ft_tsec = 0;
  1087.      ft.ft_min = 0;
  1088.      ft.ft_hour = 12;  /* Arbitrarily set time to noon. */
  1089. --- 448,460 ----
  1090.   int jul;
  1091.   #endif
  1092.   {
  1093.   #ifdef __TURBOC__   
  1094. +    int y, m, d;
  1095.      struct ftime ft;
  1096.      FILE *f;
  1097.   
  1098.      FromJulian(jul, &y, &m, &d);
  1099.      ft.ft_tsec = 0;
  1100.      ft.ft_min = 0;
  1101.      ft.ft_hour = 12;  /* Arbitrarily set time to noon. */
  1102. ***************
  1103. *** 464,488 ****
  1104.      ft.ft_day = (unsigned int) d;
  1105.      ft.ft_month = (unsigned int) m+1;
  1106.      ft.ft_year = (unsigned int) (y - 1980);
  1107. - #endif
  1108.   
  1109. !    f = fopen(fname, "r");
  1110. ! #ifdef __TURBOC__   
  1111.      if (!f || setftime(fileno(f) , &ft)) {
  1112. - #endif
  1113.   
  1114. ! #ifdef __MSC__
  1115. !    if (!f || _dos_setftime(fileno(f),
  1116. !     ((y-1980)<<9) + (m+1)<<5 + d,
  1117. !     (12<<11))) {
  1118.   #endif       
  1119.         fprintf(ErrFp, "Can't reset access date of %s\n", fname);
  1120.         if (f) fclose(f);
  1121.         return -1;
  1122.      }
  1123.   
  1124.      fclose(f);
  1125.      return 0;
  1126.   }
  1127.   #endif /* __MSDOS__ */
  1128. --- 461,485 ----
  1129.      ft.ft_day = (unsigned int) d;
  1130.      ft.ft_month = (unsigned int) m+1;
  1131.      ft.ft_year = (unsigned int) (y - 1980);
  1132.   
  1133. !    f = fopen(fname, "r"); 
  1134.      if (!f || setftime(fileno(f) , &ft)) {
  1135.   
  1136. ! #else /* Must be MSC */
  1137. !    if (utime(fname, (struct utimbuf *) NULL)) {
  1138.   #endif       
  1139.         fprintf(ErrFp, "Can't reset access date of %s\n", fname);
  1140. + #ifdef __TURBOC__
  1141.         if (f) fclose(f);
  1142. + #endif
  1143.         return -1;
  1144.      }
  1145.   
  1146. + #ifdef __TURBOC__
  1147.      fclose(f);
  1148. + #endif
  1149.      return 0;
  1150.   }
  1151.   #endif /* __MSDOS__ */
  1152. *** ../p0/funcs.c    Mon Nov  9 14:23:22 1992
  1153. --- ./funcs.c    Wed Dec 16 10:51:34 1992
  1154. ***************
  1155. *** 6,16 ****
  1156.   /*  expressions.                                               */
  1157.   /*                                                             */
  1158.   /*  This file is part of REMIND.                               */
  1159. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  1160.   /*                                                             */
  1161.   /***************************************************************/
  1162. - #include <stdio.h>
  1163.   #include "config.h"
  1164.   #ifdef HAVE_STDLIB_H
  1165.   #include <stdlib.h>
  1166.   #endif
  1167. --- 6,16 ----
  1168.   /*  expressions.                                               */
  1169.   /*                                                             */
  1170.   /*  This file is part of REMIND.                               */
  1171. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1172.   /*                                                             */
  1173.   /***************************************************************/
  1174.   #include "config.h"
  1175. + #include <stdio.h>
  1176.   #ifdef HAVE_STDLIB_H
  1177.   #include <stdlib.h>
  1178.   #endif
  1179. ***************
  1180. *** 26,32 ****
  1181.   #include <sys/file.h>
  1182.   #endif
  1183.   #endif
  1184. - /* May have to change previous line to <sys/file.h> for some unixes */
  1185.   #ifdef __MSDOS__
  1186.   #include <io.h>
  1187.   #define R_OK 4
  1188. --- 26,31 ----
  1189. ***************
  1190. *** 127,134 ****
  1191.   #define DCOPYVAL(x, y) ( (x) = (y), (y).type = ERR_TYPE )
  1192.   
  1193.   /* Convenience macros */
  1194. ! #define UPPER(c) ( ((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 'A' : (c) )
  1195. ! #define LOWER(c) ( ((c) >= 'A' && (c) <= 'Z') ? (c) + 'a' - 'A' : (c) )
  1196.   
  1197.   /* The array holding the built-in functions. */
  1198.   Operator Func[] = {
  1199. --- 126,133 ----
  1200.   #define DCOPYVAL(x, y) ( (x) = (y), (y).type = ERR_TYPE )
  1201.   
  1202.   /* Convenience macros */
  1203. ! #define UPPER(c) (islower(c) ? toupper(c) : c)
  1204. ! #define LOWER(c) (isupper(c) ? tolower(c) : c)
  1205.   
  1206.   /* The array holding the built-in functions. */
  1207.   Operator Func[] = {
  1208. ***************
  1209. *** 834,840 ****
  1210.   
  1211.   /***************************************************************/
  1212.   /*                                                             */
  1213. ! /*  FOstype - the type of operating system (UNIX or MSDOS)     */
  1214.   /*                                                             */
  1215.   /***************************************************************/
  1216.   #ifdef HAVE_PROTOS
  1217. --- 833,840 ----
  1218.   
  1219.   /***************************************************************/
  1220.   /*                                                             */
  1221. ! /*  FOstype - the type of operating system                     */
  1222. ! /*  (UNIX, OS/2, or MSDOS)                                     */
  1223.   /*                                                             */
  1224.   /***************************************************************/
  1225.   #ifdef HAVE_PROTOS
  1226. ***************
  1227. *** 846,851 ****
  1228. --- 846,855 ----
  1229.   #ifdef UNIX
  1230.      return RetStrVal("UNIX");
  1231.   #else
  1232. + #ifdef __MSC__
  1233. +     if (_osmode == OS2_MODE)
  1234. +         return RetStrVal("OS/2");
  1235. + #endif
  1236.      return RetStrVal("MSDOS");
  1237.   #endif  
  1238.   }
  1239. ***************
  1240. *** 1362,1368 ****
  1241.   PRIVATE FILE *popen(char *cmd, char *mode)
  1242.   #else
  1243.   static FILE *popen(cmd, mode)
  1244. ! char *cmd, *mode
  1245.   #endif
  1246.   {
  1247.      char *s;
  1248. --- 1366,1372 ----
  1249.   PRIVATE FILE *popen(char *cmd, char *mode)
  1250.   #else
  1251.   static FILE *popen(cmd, mode)
  1252. ! char *cmd, *mode;
  1253.   #endif
  1254.   {
  1255.      char *s;
  1256. *** ../p0/globals.h    Mon Nov  9 14:12:09 1992
  1257. --- ./globals.h    Wed Dec 16 10:51:25 1992
  1258. ***************
  1259. *** 7,13 ****
  1260.   /*  MK_GLOBALS.  Also contains useful macro definitions.       */
  1261.   /*                                                             */
  1262.   /*  This file is part of REMIND.                               */
  1263. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  1264.   /*                                                             */
  1265.   /***************************************************************/
  1266.   
  1267. --- 7,13 ----
  1268.   /*  MK_GLOBALS.  Also contains useful macro definitions.       */
  1269.   /*                                                             */
  1270.   /*  This file is part of REMIND.                               */
  1271. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1272.   /*                                                             */
  1273.   /***************************************************************/
  1274.   
  1275. ***************
  1276. *** 40,45 ****
  1277. --- 40,46 ----
  1278.   EXTERN  INIT(    int     DebugFlag, 0);
  1279.   EXTERN  INIT(   char    DoCalendar, 0);
  1280.   EXTERN  INIT(   char    DoSimpleCalendar, 0);
  1281. + EXTERN  INIT(   char    PsCal, 0);
  1282.   EXTERN  INIT(   int     CalWidth, 80);
  1283.   EXTERN  INIT(   int     CalWeeks, 0);
  1284.   EXTERN  INIT(   int     CalMonths, 0);
  1285. *** ../p0/init.c    Mon Nov  9 14:12:19 1992
  1286. --- ./init.c    Wed Dec 16 10:51:35 1992
  1287. ***************
  1288. *** 36,41 ****
  1289. --- 36,42 ----
  1290.    *  -c[n]    = Produce a calendar for n months (default = 1)
  1291.    *  -w[n]    = Specify output device width (default = 80)
  1292.    *  -s[n]    = Produce calendar in "simple calendar" format
  1293. +  *  -p[n]    = Produce calendar in format compatible with rem2ps
  1294.    *  -v       = Verbose mode
  1295.    *  -o       = Ignore ONCE directives
  1296.    *  -a       = Don't issue timed reminders which will be queued
  1297. ***************
  1298. *** 187,192 ****
  1299. --- 188,201 ----
  1300.              if (!CalMonths) CalMonths = 1;
  1301.              break;
  1302.   
  1303. +         case 'p':
  1304. +         case 'P':
  1305. +            DoSimpleCalendar = 1;
  1306. +            PsCal = 1;
  1307. +            PARSENUM(CalMonths, arg);
  1308. +            if (!CalMonths) CalMonths = 1;
  1309. +            break;
  1310.           case 'w':
  1311.           case 'W':
  1312.              PARSENUM(CalWidth, arg);
  1313. ***************
  1314. *** 303,309 ****
  1315.   #endif
  1316.   {
  1317.      fprintf(ErrFp, "\nREMIND %s Copyright 1992 by David F. Skoll\n\n", VERSION);
  1318. !    fprintf(ErrFp, "Usage: remind [options] filename [date]\n\n");
  1319.      fprintf(ErrFp, "Options:\n");
  1320.      fprintf(ErrFp, " -n     Output next occurrence of reminders in simple format\n");
  1321.      fprintf(ErrFp, " -r     Disable RUN directives\n");
  1322. --- 312,318 ----
  1323.   #endif
  1324.   {
  1325.      fprintf(ErrFp, "\nREMIND %s Copyright 1992 by David F. Skoll\n\n", VERSION);
  1326. !    fprintf(ErrFp, "        Usage: remind [options] filename [date]\n");
  1327.      fprintf(ErrFp, "Options:\n");
  1328.      fprintf(ErrFp, " -n     Output next occurrence of reminders in simple format\n");
  1329.      fprintf(ErrFp, " -r     Disable RUN directives\n");
  1330. ***************
  1331. *** 311,316 ****
  1332. --- 320,326 ----
  1333.      fprintf(ErrFp, " -c+[n] Produce a calendar for n (default 1) weeks\n");
  1334.      fprintf(ErrFp, " -w[n]  Specify width (default 80) of calendar output\n");
  1335.      fprintf(ErrFp, " -s[n]  Produce 'simple calendar' for n (1) months\n");
  1336. +    fprintf(ErrFp, " -p[n]  Same as -s, but input compatible with rem2ps\n");
  1337.      fprintf(ErrFp, " -v     Verbose mode\n");
  1338.      fprintf(ErrFp, " -o     Ignore ONCE directives\n");
  1339.      fprintf(ErrFp, " -t     Trigger all future reminders regardless of delta\n");
  1340. *** ../p0/main.c    Mon Nov  9 14:12:20 1992
  1341. --- ./main.c    Wed Dec 16 10:51:37 1992
  1342. ***************
  1343. *** 16,21 ****
  1344. --- 16,24 ----
  1345.   #ifdef HAVE_MALLOC_H
  1346.   #include <malloc.h>
  1347.   #endif
  1348. + #ifdef HAVE_UNISTD
  1349. + #include <unistd.h>
  1350. + #endif
  1351.   #include <stdio.h>
  1352.   #include <string.h>
  1353.   #ifdef HAVE_STDARG
  1354. ***************
  1355. *** 27,32 ****
  1356. --- 30,38 ----
  1357.   
  1358.   #ifdef __MSDOS__
  1359.   #include <dos.h>
  1360. + # ifdef __MSC__
  1361. + # include <time.h>
  1362. + # endif
  1363.   #endif
  1364.   
  1365.   
  1366. ***************
  1367. *** 101,108 ****
  1368.   #endif
  1369.      }
  1370.   
  1371. !    /* If it's MS-DOS, reset the file access date */
  1372. ! #ifdef __MSDOS__
  1373.      if (RealToday == JulianToday) SetAccessDate(InitialFile, RealToday);
  1374.   #endif
  1375.   
  1376. --- 107,114 ----
  1377.   #endif
  1378.      }
  1379.   
  1380. !    /* If it's MS-DOS or OS2, reset the file access date */
  1381. ! #if defined(__MSDOS__) || defined(OS2)
  1382.      if (RealToday == JulianToday) SetAccessDate(InitialFile, RealToday);
  1383.   #endif
  1384.   
  1385. ***************
  1386. *** 569,575 ****
  1387.      (void) vfprintf(ErrFp, fmt, argptr);
  1388.      (void) fputc('\n', ErrFp);
  1389.   #ifndef HAVE_STDARG
  1390. !    va_end(argptr)
  1391.   #endif
  1392.      return;
  1393.   }
  1394. --- 575,581 ----
  1395.      (void) vfprintf(ErrFp, fmt, argptr);
  1396.      (void) fputc('\n', ErrFp);
  1397.   #ifndef HAVE_STDARG
  1398. !    va_end(argptr);
  1399.   #endif
  1400.      return;
  1401.   }
  1402. ***************
  1403. *** 676,683 ****
  1404.   long SystemTime()
  1405.   #endif
  1406.   {
  1407. ! #ifdef __MSDOS__
  1408. ! #ifdef __TURBOC__
  1409.   /* Get time in Turbo C */
  1410.   
  1411.      struct time t;
  1412. --- 682,688 ----
  1413.   long SystemTime()
  1414.   #endif
  1415.   {
  1416. ! #if defined( __MSDOS__ ) && defined( __TURBOC__ )
  1417.   /* Get time in Turbo C */
  1418.   
  1419.      struct time t;
  1420. ***************
  1421. *** 685,701 ****
  1422.      gettime(&t);
  1423.      return (long) t.ti_hour * 3600L + (long) t.ti_min * 60L +
  1424.         (long) t.ti_sec;
  1425.   #else
  1426. ! /* Get time in Microsoft C */
  1427. !    struct dostime_t tloc;
  1428. !    _dos_gettime(&tloc);
  1429. !    return (long) tloc.hour * 3600L + (long) tloc.minute * 60L +
  1430. !       (long) tloc.second;
  1431. ! #endif
  1432. ! #else
  1433. ! /* Get time in Unix */
  1434.     time_t tloc;
  1435.     struct tm *t;
  1436.   
  1437. --- 690,697 ----
  1438.      gettime(&t);
  1439.      return (long) t.ti_hour * 3600L + (long) t.ti_min * 60L +
  1440.         (long) t.ti_sec;
  1441.   #else
  1442. ! /* Get time in Unix or with MSC */
  1443.     time_t tloc;
  1444.     struct tm *t;
  1445.   
  1446. ***************
  1447. *** 723,730 ****
  1448.   int *y;
  1449.   #endif
  1450.   {
  1451. ! #ifdef __MSDOS__
  1452. ! #ifdef __TURBOC__
  1453.   /* Get today's date in Turbo C */
  1454.      struct date da;
  1455.   
  1456. --- 719,725 ----
  1457.   int *y;
  1458.   #endif
  1459.   {
  1460. ! #if defined( __MSDOS__ ) && defined( __TURBOC__ )
  1461.   /* Get today's date in Turbo C */
  1462.      struct date da;
  1463.   
  1464. ***************
  1465. *** 733,751 ****
  1466.      *m = da.da_mon - 1;
  1467.      *d = da.da_day;
  1468.   #else
  1469. ! /* Get today's date in Microsoft C */
  1470. !    struct dosdate_t buf;
  1471. !    _dos_getdate(&buf);
  1472. !    *d = buf.day;
  1473. !    *m = buf.month - 1;
  1474. !    *y = buf.year;
  1475. ! #endif
  1476. ! #else
  1477. ! /* Get today's date in UNIX */
  1478. !   time_t tloc;
  1479. !   struct tm *t;
  1480.   
  1481.      (void) time(&tloc);
  1482.      t = localtime(&tloc);
  1483. --- 728,736 ----
  1484.      *m = da.da_mon - 1;
  1485.      *d = da.da_day;
  1486.   #else
  1487. ! /* Get today's date in UNIX or with MSC */
  1488. !    time_t tloc;
  1489. !    struct tm *t;
  1490.   
  1491.      (void) time(&tloc);
  1492.      t = localtime(&tloc);
  1493. *** ../p0/makefile.msc    Mon Nov  9 14:12:34 1992
  1494. --- ./makefile.msc    Wed Dec 16 10:51:53 1992
  1495. ***************
  1496. *** 55,57 ****
  1497. --- 55,64 ----
  1498.   
  1499.   remind.exe: $(OBJS)
  1500.       link /NOI @lnk.msc
  1501. + rem2ps.obj: rem2ps.c
  1502. +     cl /c $(DEFINES) $(MODEL) /Forem2ps.obj rem2ps.c
  1503. + rem2ps.exe: rem2ps.obj
  1504. +     link /NOI rem2ps,rem2ps.exe,,,
  1505. *** ../p0/makefile.tc    Mon Nov  9 14:12:33 1992
  1506. --- ./makefile.tc    Wed Dec 16 10:51:51 1992
  1507. ***************
  1508. *** 1,6 ****
  1509.   # Makefile for REMIND for Turbo C for MSDOS
  1510.   
  1511. ! VERSION= 03.00.00
  1512.   
  1513.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
  1514.   
  1515. --- 1,6 ----
  1516.   # Makefile for REMIND for Turbo C for MSDOS
  1517.   
  1518. ! VERSION= 03.00.01
  1519.   
  1520.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
  1521.   
  1522. ***************
  1523. *** 15,27 ****
  1524.   
  1525.   MANIFEST= readme.uni readme.dos copyrigh $(HDRS) $(SRCS) makefile rem rem.1 \
  1526.   remind.1 remind-a.csh remind-a.sh test.rem test-rem test.cmp makefile.tc \
  1527. ! makefile.msc lnk.msc lnk.tc manifest.dos manifest.unx whatsnew.30 kall kall.1
  1528.   
  1529.   remind.exe: $(OBJS)
  1530.       tcc @lnk.tc
  1531.   
  1532.   .c.obj:
  1533.       tcc -A -w-pia -c -O -ms {$< }
  1534.   
  1535.   calendar.obj: calendar.c $(STDHDRS) expr.h
  1536.   
  1537. --- 15,35 ----
  1538.   
  1539.   MANIFEST= readme.uni readme.dos copyrigh $(HDRS) $(SRCS) makefile rem rem.1 \
  1540.   remind.1 remind-a.csh remind-a.sh test.rem test-rem test.cmp makefile.tc \
  1541. ! makefile.msc lnk.msc lnk.tc manifest.dos manifest.unx whatsnew.30 kall kall.1 \
  1542. ! defs.rem readme.os2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1
  1543.   
  1544. + all: remind.exe rem2ps.exe
  1545.   remind.exe: $(OBJS)
  1546.       tcc @lnk.tc
  1547.   
  1548. + rem2ps.exe: rem2ps.obj
  1549. +     tcc -erem2ps.exe rem2ps.obj
  1550.   .c.obj:
  1551.       tcc -A -w-pia -c -O -ms {$< }
  1552. + rem2ps.obj: rem2ps.c rem2ps.h config.h
  1553.   
  1554.   calendar.obj: calendar.c $(STDHDRS) expr.h
  1555.   
  1556. *** ../p0/protos.h    Mon Nov  9 14:12:10 1992
  1557. --- ./protos.h    Wed Dec 16 10:51:26 1992
  1558. ***************
  1559. *** 5,11 ****
  1560.   /*  Function Prototypes.                                       */
  1561.   /*                                                             */
  1562.   /*  This file is part of REMIND.                               */
  1563. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  1564.   /*                                                             */
  1565.   /***************************************************************/
  1566.   #ifdef HAVE_PROTOS
  1567. --- 5,11 ----
  1568.   /*  Function Prototypes.                                       */
  1569.   /*                                                             */
  1570.   /*  This file is part of REMIND.                               */
  1571. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1572.   /*                                                             */
  1573.   /***************************************************************/
  1574.   #ifdef HAVE_PROTOS
  1575. ***************
  1576. *** 110,112 ****
  1577. --- 110,113 ----
  1578.   int DoPreserve  ARGS ((Parser *p));
  1579.   int DoSatRemind ARGS ((Trigger *trig, TimeTrig *tim, ParsePtr p));
  1580.   int ParseNonSpaceChar ARGS ((ParsePtr p, int *err, int peek));
  1581. + int HashVal ARGS ((const char *str));
  1582. *** ../p0/queue.c    Mon Nov  9 14:12:22 1992
  1583. --- ./queue.c    Wed Dec 16 10:51:38 1992
  1584. ***************
  1585. *** 8,18 ****
  1586.   /*  Copyright (C) 1992 by David F. Skoll.                      */
  1587.   /*                                                             */
  1588.   /***************************************************************/
  1589.   #include <stdio.h>
  1590.   #include <signal.h>
  1591.   #include <sys/types.h>
  1592.   #include <sys/stat.h>
  1593. - #include "config.h"
  1594.   #ifdef HAVE_STDLIB_H
  1595.   #include <stdlib.h>
  1596.   #endif
  1597. --- 8,18 ----
  1598.   /*  Copyright (C) 1992 by David F. Skoll.                      */
  1599.   /*                                                             */
  1600.   /***************************************************************/
  1601. + #include "config.h"
  1602.   #include <stdio.h>
  1603.   #include <signal.h>
  1604.   #include <sys/types.h>
  1605.   #include <sys/stat.h>
  1606.   #ifdef HAVE_STDLIB_H
  1607.   #include <stdlib.h>
  1608.   #endif
  1609. ***************
  1610. *** 19,24 ****
  1611. --- 19,27 ----
  1612.   #ifdef HAVE_MALLOC_H
  1613.   #include <malloc.h>
  1614.   #endif
  1615. + #ifdef HAVE_UNISTD
  1616. + #include <unistd.h>
  1617. + #endif
  1618.   #include "globals.h"
  1619.   #include "err.h"
  1620.   #include "types.h"
  1621. ***************
  1622. *** 174,179 ****
  1623. --- 177,183 ----
  1624.         /* Trigger the reminder */
  1625.         CreateParser(q->text, &p);
  1626.         trig.typ = q->typ;
  1627. +       RunDisabled = q->RunDisabled;
  1628.         (void) TriggerReminder(&p, &trig, &q->tt, JulianToday);
  1629.         fflush(stdout);
  1630.         
  1631. *** ../p0/remind.1    Mon Nov  9 14:12:29 1992
  1632. --- ./remind.1    Wed Dec 16 10:51:48 1992
  1633. ***************
  1634. *** 1,4 ****
  1635. ! .TH REMIND 1 "20 October 1992"
  1636.   .UC4
  1637.   .SH NAME
  1638.   remind \- a sophisticated reminder service
  1639. --- 1,4 ----
  1640. ! .TH REMIND 1 "11 November 1992"
  1641.   .UC4
  1642.   .SH NAME
  1643.   remind \- a sophisticated reminder service
  1644. ***************
  1645. *** 38,43 ****
  1646. --- 38,48 ----
  1647.   format" which can be used as input for more sophisticated calendar-drawing
  1648.   programs.
  1649.   .TP
  1650. + .B \-p\fR\fIn\fR
  1651. + The \fB\-p\fR option is very similar to the \fB\-s\fR option, except
  1652. + that the output contains additional information for use by the
  1653. + \fBrem2ps\fR program, which creates a PostScript calendar.
  1654. + .TP
  1655.   .B \-v
  1656.   The \fB\-v\fR option makes the output of \fBRemind\fR slightly more verbose.
  1657.   .TP
  1658. ***************
  1659. *** 1149,1163 ****
  1660.   .RE
  1661.   .TP
  1662.   .B DATE constants
  1663. ! \fBDATE\fR constants have no readable representation.  They must be
  1664. ! created with the \fBdate()\fR function, which takes the year, month
  1665. ! and day as arguments:
  1666.   .PP
  1667.   .RS
  1668. ! date(1992, 2, 29), date(1996, 4, 2), date(2001, 12, 17)
  1669.   .PP
  1670. ! However, \fBDATE\fR constants are \fIprinted\fR as
  1671. ! \fIyyyy\fR/\fImm\fR/\fIdd\fR.
  1672.   .RE
  1673.   .PP
  1674.   .B OPERATORS
  1675. --- 1154,1170 ----
  1676.   .RE
  1677.   .TP
  1678.   .B DATE constants
  1679. ! \fBDATE\fR constants are expressed as 'yyyy/mm/dd', and the single
  1680. ! quotes \fImust\fR be supplied.  This distinguishes date constants
  1681. ! from division of integers.  Examples:
  1682.   .PP
  1683.   .RS
  1684. ! '1993/02/22', '1992/12/25', '1999/01/01'
  1685.   .PP
  1686. ! Note that \fBDATE\fR constants are \fIprinted\fR as
  1687. ! \fIyyyy\fR/\fImm\fR/\fIdd\fR without the quotes.  Note also that versions
  1688. ! of \fBRemind\fR prior to 03.00.01 did not support date constants.  In those
  1689. ! versions, you must create dates using the \fBdate()\fR function.
  1690.   .RE
  1691.   .PP
  1692.   .B OPERATORS
  1693. ***************
  1694. *** 1372,1377 ****
  1695. --- 1379,1389 ----
  1696.   a \fBSTRING\fR consisting of the characters specified by the arguments.
  1697.   Note that none of the arguments can be 0, unless there is only one
  1698.   argument.  As a special case, \fBchar(0)\fR returns "".
  1699. + .PP
  1700. + Note that because \fBRemind\fR does not support escaping of characters
  1701. + in strings, the only way to get a double-quote in a string is to use
  1702. + \fBchar(34)\fR.  Yes, I know it's not portable - it assumes ASCII
  1703. + coding.
  1704.   .TP
  1705.   .B choose(i_index, x_arg1 [,x_arg2...])
  1706.   \fBChoose\fR must take at least two arguments, the first of which is
  1707. ***************
  1708. *** 1525,1531 ****
  1709.   \fBord(2)\fR returns "2nd", and \fBord(213)\fR returns "213th".
  1710.   .TP
  1711.   .B ostype()
  1712. ! Returns "UNIX" on UNIX systems, and "MSDOS" on MS-DOS systems.
  1713.   .TP
  1714.   .B plural(i_num [,s_str1 [,s_str2]])
  1715.   Can take from one to three arguments.  If one argument is supplied, returns
  1716. --- 1537,1545 ----
  1717.   \fBord(2)\fR returns "2nd", and \fBord(213)\fR returns "213th".
  1718.   .TP
  1719.   .B ostype()
  1720. ! Returns "UNIX" on UNIX systems, "MSDOS" on MS-DOS systems, and "OS/2"
  1721. ! on OS/2 systems.  If you run \fBRemind\fR in an MS-DOS box under OS/2,
  1722. ! this function returns "MSDOS".
  1723.   .TP
  1724.   .B plural(i_num [,s_str1 [,s_str2]])
  1725.   Can take from one to three arguments.  If one argument is supplied, returns
  1726. ***************
  1727. *** 1615,1621 ****
  1728.   .TP
  1729.   .B version()
  1730.   Returns a string specifying the version of \fBRemind\fR.  For version 
  1731. ! 03.00.00, returns "03.00.00".  It is guaranteed that as new versions of
  1732.   \fBRemind\fR are released, the value returned by \fBversion()\fR will
  1733.   strictly increase, according to the rules for string ordering.
  1734.   .TP
  1735. --- 1629,1635 ----
  1736.   .TP
  1737.   .B version()
  1738.   Returns a string specifying the version of \fBRemind\fR.  For version 
  1739. ! 03.00.01, returns "03.00.01".  It is guaranteed that as new versions of
  1740.   \fBRemind\fR are released, the value returned by \fBversion()\fR will
  1741.   strictly increase, according to the rules for string ordering.
  1742.   .TP
  1743. ***************
  1744. *** 2009,2024 ****
  1745.   .PP
  1746.   .SH CALENDAR MODE
  1747.   .PP
  1748. ! If you supply the \fB\-c\fR or \fB\-s\fR command-line option, the \fBRemind\fR
  1749.   runs in "calendar mode."  In this mode, \fBRemind\fR interprets the script
  1750.   repeatedly, performing one iteration through the whole file for each day
  1751.   in the calendar.  Reminders which trigger are saved in internal buffers,
  1752.   and then inserted into the calendar in the appropriate places.
  1753.   .PP
  1754. ! For example, if you have a reminder script called ".reminders", and you
  1755. ! executed this command:
  1756.   .PP
  1757.   .nf
  1758.       remind -c .reminders jan 1993
  1759.   .fi
  1760.   .PP
  1761. --- 2023,2049 ----
  1762.   .PP
  1763.   .SH CALENDAR MODE
  1764.   .PP
  1765. ! If you supply the \fB\-c\fR, \fB\-s\fR or \fB\-p\fR
  1766. ! command-line option, then \fBRemind\fR
  1767.   runs in "calendar mode."  In this mode, \fBRemind\fR interprets the script
  1768.   repeatedly, performing one iteration through the whole file for each day
  1769.   in the calendar.  Reminders which trigger are saved in internal buffers,
  1770.   and then inserted into the calendar in the appropriate places.
  1771.   .PP
  1772. ! The \fB\-p\fR option is used in conjunction with the \fBrem2ps\fR
  1773. ! program to produce a calendar in PostScript format.  For example, the
  1774. ! following command will send PostScript code to standard output:
  1775.   .PP
  1776.   .nf
  1777. +     remind -p .reminders | rem2ps
  1778. + .fi
  1779. + .PP
  1780. + You can print a PostScript calendar by piping this to the \fBlpr\fR command.
  1781. + .PP
  1782. + If you have a reminder script called ".reminders", and you
  1783. + execute this command:
  1784. + .PP
  1785. + .nf
  1786.       remind -c .reminders jan 1993
  1787.   .fi
  1788.   .PP
  1789. ***************
  1790. *** 2205,2210 ****
  1791. --- 2230,2249 ----
  1792.   that the trigger date is issued only in election years, which are
  1793.   multiples of 4.  The second \fBREM\fR command actually issues the
  1794.   reminder.
  1795. + .PP
  1796. + .B DETAILS ABOUT TRIGVALID()
  1797. + .PP
  1798. + The \fBtrigvalid()\fR function returns 1 if \fBRemind\fR could find a trigger
  1799. + date for the previous \fBREM\fR or \fBIFTRIG\fR command.  More specifically,
  1800. + it returns 1 if \fBRemind\fR finds a date \fInot in the past\fR which
  1801. + satisfies the trigger.  In addition, there is one special case in which
  1802. + \fBtrigvalid()\fR returns 1 and \fBtrigdate()\fR returns a meaningful result:
  1803. + .PP
  1804. + If the \fBREM\fR or \fBIFTRIG\fR command did not contain an \fBUNTIL\fR
  1805. + clause, and contained all of the \fIday\fR, \fImonth\fR and \fIyear\fR
  1806. + components, then \fBRemind\fR will correctly compute a trigger date, even
  1807. + if it happens to be in the past.  Note that this behaviour is not true for
  1808. + versions of \fBRemind\fR prior to 03.00.01.
  1809.   .SH AUTHOR
  1810.   .PP
  1811.   David F. Skoll
  1812. ***************
  1813. *** 2212,2218 ****
  1814.   .PP
  1815.   Date calculation is a bit "brute force."
  1816.   .PP
  1817. ! The MS-DOS version of \fBRemind\fR does not support queuing or timed
  1818.   activation of reminders.
  1819.   .PP
  1820.   \fBRemind\fR has some built-in limits on total line length,
  1821. --- 2251,2257 ----
  1822.   .PP
  1823.   Date calculation is a bit "brute force."
  1824.   .PP
  1825. ! The MS-DOS and OS/2 versions of \fBRemind\fR do not support queuing or timed
  1826.   activation of reminders.
  1827.   .PP
  1828.   \fBRemind\fR has some built-in limits on total line length,
  1829. ***************
  1830. *** 2220,2223 ****
  1831.   .PP
  1832.   .SH SEE ALSO
  1833.   .pp
  1834. ! rem, elm, kall
  1835. --- 2259,2262 ----
  1836.   .PP
  1837.   .SH SEE ALSO
  1838.   .pp
  1839. ! rem, elm, kall, rem2ps
  1840. *** ../p0/test-rem    Mon Nov  9 14:12:33 1992
  1841. --- ./test-rem    Wed Dec 16 10:51:51 1992
  1842. ***************
  1843. *** 1,8 ****
  1844. ! #!/bin/csh -f
  1845. ! setenv TEST_GETENV "foo bar baz"
  1846.   ./remind -e -dxtev ./test.rem 16 feb 1991 > ./test.out
  1847.   cmp -s ./test.out ./test.cmp
  1848. ! if ($status == 0) then
  1849.      echo "Remind:  Acceptance test PASSED"
  1850.      exit 0
  1851.   else
  1852. --- 1,8 ----
  1853. ! #!/bin/sh
  1854. ! TEST_GETENV="foo bar baz" ; export TEST_GETENV
  1855.   ./remind -e -dxtev ./test.rem 16 feb 1991 > ./test.out
  1856.   cmp -s ./test.out ./test.cmp
  1857. ! if [ "$?" = "0" ]; then
  1858.      echo "Remind:  Acceptance test PASSED"
  1859.      exit 0
  1860.   else
  1861. ***************
  1862. *** 11,14 ****
  1863.      echo "Examine the file test.out to see where it differs from the"
  1864.      echo "reference file test.cmp."
  1865.      exit 1
  1866. ! endif
  1867. --- 11,14 ----
  1868.      echo "Examine the file test.out to see where it differs from the"
  1869.      echo "reference file test.cmp."
  1870.      exit 1
  1871. ! fi
  1872. *** ../p0/test.cmp    Mon Nov  9 14:12:33 1992
  1873. --- ./test.cmp    Wed Dec 16 10:51:51 1992
  1874. ***************
  1875. *** 349,355 ****
  1876.   "a05" + "6" => "a056"
  1877.   value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  1878.   set a058 version()
  1879. ! version() => "03.00.00"
  1880.   set a059 wkday(today())
  1881.   today() => 1991/02/16
  1882.   wkday(1991/02/16) => "Saturday"
  1883. --- 349,355 ----
  1884.   "a05" + "6" => "a056"
  1885.   value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  1886.   set a058 version()
  1887. ! version() => "03.00.01"
  1888.   set a059 wkday(today())
  1889.   today() => 1991/02/16
  1890.   wkday(1991/02/16) => "Saturday"
  1891. ***************
  1892. *** 453,459 ****
  1893.           a048  "foo"
  1894.           a067  "INT"
  1895.           a039  "February"
  1896. !         a058  "03.00.00"
  1897.           a049  21
  1898.           a068  "STRING"
  1899.           a059  "Saturday"
  1900. --- 453,459 ----
  1901.           a048  "foo"
  1902.           a067  "INT"
  1903.           a039  "February"
  1904. !         a058  "03.00.01"
  1905.           a049  21
  1906.           a068  "STRING"
  1907.           a059  "Saturday"
  1908. *** ../p0/token.c    Mon Nov  9 14:12:22 1992
  1909. --- ./token.c    Wed Dec 16 10:51:39 1992
  1910. ***************
  1911. *** 6,17 ****
  1912.   /*  classifying the tokens parsed.                             */
  1913.   /*                                                             */
  1914.   /*  This file is part of REMIND.                               */
  1915. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  1916.   /*                                                             */
  1917.   /***************************************************************/
  1918.   #include <stdio.h>
  1919.   #include <ctype.h>
  1920. - #include "config.h"
  1921.   #ifdef HAVE_STDLIB_H
  1922.   #include <stdlib.h>
  1923.   #endif
  1924. --- 6,17 ----
  1925.   /*  classifying the tokens parsed.                             */
  1926.   /*                                                             */
  1927.   /*  This file is part of REMIND.                               */
  1928. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1929.   /*                                                             */
  1930.   /***************************************************************/
  1931. + #include "config.h"
  1932.   #include <stdio.h>
  1933.   #include <ctype.h>
  1934.   #ifdef HAVE_STDLIB_H
  1935.   #include <stdlib.h>
  1936.   #endif
  1937. *** ../p0/trigger.c    Mon Nov  9 14:12:23 1992
  1938. --- ./trigger.c    Wed Dec 16 10:51:40 1992
  1939. ***************
  1940. *** 5,16 ****
  1941.   /*  Routines for figuring out the trigger date of a reminder   */
  1942.   /*                                                             */
  1943.   /*  This file is part of REMIND.                               */
  1944. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  1945.   /*                                                             */
  1946.   /***************************************************************/
  1947.   
  1948. - #include <stdio.h>
  1949.   #include "config.h"
  1950.   #ifdef HAVE_STDLIB_H
  1951.   #include <stdlib.h>
  1952.   #endif
  1953. --- 5,16 ----
  1954.   /*  Routines for figuring out the trigger date of a reminder   */
  1955.   /*                                                             */
  1956.   /*  This file is part of REMIND.                               */
  1957. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1958.   /*                                                             */
  1959.   /***************************************************************/
  1960.   
  1961.   #include "config.h"
  1962. + #include <stdio.h>
  1963.   #ifdef HAVE_STDLIB_H
  1964.   #include <stdlib.h>
  1965.   #endif
  1966. ***************
  1967. *** 439,448 ****
  1968. --- 439,456 ----
  1969.            fprintf(ErrFp, "%s(%d): Expired\n",
  1970.                    FileName, LineNo);
  1971.            }
  1972. +          if (result != -1) {
  1973. +             LastTriggerDate = result;
  1974. +         LastTrigValid = 1;
  1975. +          }
  1976.            return -1;
  1977.         }
  1978.         /* Keep scanning... unless there's no point in doing it.*/
  1979.         if (nextstart <= start) {
  1980. +            if (result != -1) {
  1981. +         LastTriggerDate = result;
  1982. +         LastTrigValid = 1;
  1983. +      }
  1984.            if (DebugFlag & DB_PRTTRIG) {
  1985.           fprintf(ErrFp, "%s(%d): Expired\n",
  1986.                     FileName, LineNo);
  1987. *** ../p0/types.h    Mon Nov  9 14:12:10 1992
  1988. --- ./types.h    Wed Dec 16 10:51:26 1992
  1989. ***************
  1990. *** 5,11 ****
  1991.   /*  Type definitions all dumped here.                          */
  1992.   /*                                                             */
  1993.   /*  This file is part of REMIND.                               */
  1994. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  1995.   /*                                                             */
  1996.   /***************************************************************/
  1997.   /* Values */
  1998. --- 5,11 ----
  1999.   /*  Type definitions all dumped here.                          */
  2000.   /*                                                             */
  2001.   /*  This file is part of REMIND.                               */
  2002. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  2003.   /*                                                             */
  2004.   /***************************************************************/
  2005.   /* Values */
  2006. *** ../p0/utils.c    Mon Nov  9 14:12:24 1992
  2007. --- ./utils.c    Wed Dec 16 10:51:41 1992
  2008. ***************
  2009. *** 5,17 ****
  2010.   /*  Useful utility functions.                                  */
  2011.   /*                                                             */
  2012.   /*  This file is part of REMIND.                               */
  2013. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  2014.   /*                                                             */
  2015.   /***************************************************************/
  2016.   
  2017.   #include <string.h>
  2018.   #include <stdio.h>
  2019. - #include "config.h"
  2020.   #ifdef HAVE_STDLIB_H
  2021.   #include <stdlib.h>
  2022.   #endif
  2023. --- 5,17 ----
  2024.   /*  Useful utility functions.                                  */
  2025.   /*                                                             */
  2026.   /*  This file is part of REMIND.                               */
  2027. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  2028.   /*                                                             */
  2029.   /***************************************************************/
  2030.   
  2031. + #include "config.h"
  2032.   #include <string.h>
  2033.   #include <stdio.h>
  2034.   #ifdef HAVE_STDLIB_H
  2035.   #include <stdlib.h>
  2036.   #endif
  2037. ***************
  2038. *** 18,25 ****
  2039.   #ifdef HAVE_MALLOC_H
  2040.   #include <malloc.h>
  2041.   #endif
  2042.   
  2043. ! #define UPPER(c) ( ((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 'A' : (c) )
  2044.   
  2045.   /***************************************************************/
  2046.   /*                                                             */
  2047. --- 18,26 ----
  2048.   #ifdef HAVE_MALLOC_H
  2049.   #include <malloc.h>
  2050.   #endif
  2051. + #include <ctype.h>
  2052.   
  2053. ! #define UPPER(c) (islower(c) ? toupper(c) : c)
  2054.   
  2055.   /***************************************************************/
  2056.   /*                                                             */
  2057. *** ../p0/var.c    Mon Nov  9 14:12:25 1992
  2058. --- ./var.c    Wed Dec 16 10:51:42 1992
  2059. ***************
  2060. *** 6,17 ****
  2061.   /*  user- and system-defined variables.                        */
  2062.   /*                                                             */
  2063.   /*  This file is part of REMIND.                               */
  2064. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  2065.   /*                                                             */
  2066.   /***************************************************************/
  2067.   
  2068. - #include <stdio.h>
  2069.   #include "config.h"
  2070.   #ifdef HAVE_STDLIB_H
  2071.   #include <stdlib.h>
  2072.   #endif
  2073. --- 6,17 ----
  2074.   /*  user- and system-defined variables.                        */
  2075.   /*                                                             */
  2076.   /*  This file is part of REMIND.                               */
  2077. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  2078.   /*                                                             */
  2079.   /***************************************************************/
  2080.   
  2081.   #include "config.h"
  2082. + #include <stdio.h>
  2083.   #ifdef HAVE_STDLIB_H
  2084.   #include <stdlib.h>
  2085.   #endif
  2086. ***************
  2087. *** 18,23 ****
  2088. --- 18,24 ----
  2089.   #ifdef HAVE_MALLOC_H
  2090.   #include <malloc.h>
  2091.   #endif
  2092. + #include <ctype.h>
  2093.   #include "types.h"
  2094.   #include "expr.h"
  2095.   #include "globals.h"
  2096. ***************
  2097. *** 24,30 ****
  2098.   #include "protos.h"
  2099.   #include "err.h"
  2100.   
  2101. ! #define UPPER(c) ( ((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 'A' : (c) )
  2102.   
  2103.   /* The variable hash table */
  2104.   #define VAR_HASH_SIZE 64
  2105. --- 25,31 ----
  2106.   #include "protos.h"
  2107.   #include "err.h"
  2108.   
  2109. ! #define UPPER(c) (islower(c) ? toupper(c) : c)
  2110.   
  2111.   /* The variable hash table */
  2112.   #define VAR_HASH_SIZE 64
  2113. ***************
  2114. *** 377,383 ****
  2115.   
  2116.   /***************************************************************/
  2117.   /*                                                             */
  2118. ! /*  DoPreserve - delete a bunch of variables.                  */
  2119.   /*                                                             */
  2120.   /***************************************************************/
  2121.   #ifdef HAVE_PROTOS
  2122. --- 378,384 ----
  2123.   
  2124.   /***************************************************************/
  2125.   /*                                                             */
  2126. ! /*  DoPreserve - preserve a bunch of variables.                */
  2127.   /*                                                             */
  2128.   /***************************************************************/
  2129.   #ifdef HAVE_PROTOS
  2130.